// show a successbox, if the user rights was saved successfully
if ( $request->getCheck( 'success' ) && $this->mFetchedUser !== null ) {
- $out->wrapWikiMsg(
- "<div class=\"successbox\">\n$1\n</div>",
- [ 'savedrights', $this->mFetchedUser->getName() ]
+ $out->addModules( [ 'mediawiki.special.userrights' ] );
+ $out->addModuleStyles( 'mediawiki.notification.convertmessagebox.styles' );
+ $out->addHtml(
+ Html::rawElement(
+ 'div',
+ [
+ 'class' => 'mw-notify-success successbox',
+ 'id' => 'mw-preferences-success',
+ 'data-mw-autohide' => 'false',
+ ],
+ Html::element(
+ 'p',
+ [],
+ $this->msg( 'savedrights', $this->mFetchedUser->getName() )->text()
+ )
+ )
);
}
* @return array Tuple of added, then removed groups
*/
function doSaveUserGroups( $user, $add, $remove, $reason = '' ) {
- global $wgAuth;
-
// Validate input set...
$isself = $user->getName() == $this->getUser()->getName();
$groups = $user->getGroups();
// update groups in external authentication database
Hooks::run( 'UserGroupsChanged', [ $user, $add, $remove, $this->getUser(), $reason ] );
- $wgAuth->updateExternalDBGroups( $user, $add, $remove );
+ MediaWiki\Auth\AuthManager::callLegacyAuthPlugin(
+ 'updateExternalDBGroups', [ $user, $add, $remove ]
+ );
wfDebug( 'oldGroups: ' . print_r( $oldGroups, true ) . "\n" );
wfDebug( 'newGroups: ' . print_r( $newGroups, true ) . "\n" );